/* 基础样式 */
:root {
    --primary-color: #6D94F7;
    --secondary-color: #8a6df7;
    --accent-color: #f76d8e;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-light: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f5f7fa;
}

/* 导航栏样式 */


.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo img {
    height: 40px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
}

#user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

#user-name {
    margin-right: 15px;
    font-weight: 500;
}

#logout-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-weight: 500;
}

/* 测验管理主内容 */
.quiz-manager {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.quiz-header h1 {
    font-size: 2rem;
    color: var(--dark-color);
}

.quiz-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #5a7de6;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-cancel {
    background-color: var(--text-light);
    color: white;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

/* 题目列表样式 */
.quiz-questions {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.empty-state {
    text-align: center;
    padding: 50px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.question-card {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-number {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.question-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background-color: rgba(var(--warning-color), 0.1);
    color: var(--warning-color);
}

.btn-edit:hover {
    background-color: rgba(var(--warning-color), 0.2);
}

.btn-delete {
    background-color: rgba(var(--danger-color), 0.1);
    color: var(--danger-color);
}

.btn-delete:hover {
    background-color: rgba(var(--danger-color), 0.2);
}

.question-content {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.question-options {
    margin-left: 30px;
}

.option-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.option-letter {
    font-weight: bold;
    margin-right: 10px;
    width: 25px;
}

.correct-option {
    color: var(--success-color);
    font-weight: bold;
}

.question-explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(var(--primary-color), 0.05);
    border-radius: 5px;
    font-size: 0.95rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    padding: 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.close-modal:hover {
    color: var(--text-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group textarea, .form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.option-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.option-item input[type="radio"] {
    margin-right: 10px;
}

.option-item input[type="text"] {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* 页脚样式 */
.footer {
    /* background-color: var(--dark-color); */
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul {/* 基础样式 */
        :root {
            --primary-color: #6D94F7;
            --secondary-color: #8a6df7;
            --accent-color: #f76d8e;
            --dark-color: #1a1a2e;
            --light-color: #f8f9fa;
            --text-color: #333;
            --text-light: #6c757d;
            --success-color: #28a745;
            --danger-color: #dc3545;
            --warning-color: #ffc107;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            color: var(--text-color);
            line-height: 1.6;
            background-color: #f5f7fa;
        }
        
        /* 导航栏样式 */
        .navbar {
            background-color: white;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 15px 0;
            position: sticky;
            top: 0;
            z-index: 100;
        }
        
        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }
        
        .logo img {
            height: 40px;
        }
        
        nav ul {
            display: flex;
            list-style: none;
        }
        
        nav ul li {
            margin-left: 30px;
        }
        
        nav ul li a {
            text-decoration: none;
            color: var(--text-color);
            font-weight: 500;
            transition: color 0.3s;
        }
        
        nav ul li a:hover, nav ul li a.active {
            color: var(--primary-color);
        }
        
        .user-info {
            display: flex;
            align-items: center;
        }
        
        #user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
            object-fit: cover;
        }
        
        #user-name {
            margin-right: 15px;
            font-weight: 500;
        }
        
        #logout-btn {
            background: none;
            border: none;
            color: var(--danger-color);
            cursor: pointer;
            font-weight: 500;
        }
        
        /* 测验管理主内容 */
        .quiz-manager {
            max-width: 1200px;
            margin: 30px auto;
            padding: 0 20px;
        }
        
        .quiz-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
        }
        
        .quiz-header h1 {
            font-size: 2rem;
            color: var(--dark-color);
        }
        
        .quiz-actions {
            display: flex;
            gap: 15px;
        }
        
        .btn {
            padding: 10px 20px;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: #5a7de6;
            transform: translateY(-2px);
        }
        
        .btn-success {
            background-color: var(--success-color);
            color: white;
        }
        
        .btn-success:hover {
            background-color: #218838;
            transform: translateY(-2px);
        }
        
        .btn-secondary {
            background-color: var(--text-light);
            color: white;
        }
        
        .btn-secondary:hover {
            background-color: #5a6268;
            transform: translateY(-2px);
        }
        
        .btn-cancel {
            background-color: var(--text-light);
            color: white;
        }
        
        .btn-cancel:hover {
            background-color: #5a6268;
        }
        
        /* 题目列表样式 */
        .quiz-questions {
            display: flex;
            flex-direction: column;
            gap: 25px;
        }
        
        .empty-state {
            text-align: center;
            padding: 50px;
            color: var(--text-light);
        }
        
        .empty-state i {
            font-size: 3rem;
            margin-bottom: 20px;
            color: var(--primary-color);
        }
        
        .question-card {
            background-color: white;
            border-radius: 8px;
            padding: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            position: relative;
        }
        
        .question-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .question-number {
            font-weight: bold;
            font-size: 1.1rem;
            color: var(--primary-color);
        }
        
        .question-actions {
            display: flex;
            gap: 10px;
        }
        
        .btn-icon {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .btn-edit {
            background-color: rgba(var(--warning-color), 0.1);
            color: var(--warning-color);
        }
        
        .btn-edit:hover {
            background-color: rgba(var(--warning-color), 0.2);
        }
        
        .btn-delete {
            background-color: rgba(var(--danger-color), 0.1);
            color: var(--danger-color);
        }
        
        .btn-delete:hover {
            background-color: rgba(var(--danger-color), 0.2);
        }
        
        .question-content {
            margin-bottom: 20px;
            font-size: 1.1rem;
        }
        
        .question-options {
            margin-left: 30px;
        }
        
        .option-item {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .option-letter {
            font-weight: bold;
            margin-right: 10px;
            width: 25px;
        }
        
        .correct-option {
            color: var(--success-color);
            font-weight: bold;
        }
        
        .question-explanation {
            margin-top: 20px;
            padding: 15px;
            background-color: rgba(var(--primary-color), 0.05);
            border-radius: 5px;
            font-size: 0.95rem;
        }
        
        /* 模态框样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 200;
            align-items: center;
            justify-content: center;
        }
        
        .modal-content {
            background-color: white;
            border-radius: 10px;
            width: 90%;
            max-width: 700px;
            padding: 30px;
            position: relative;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .close-modal {
            position: absolute;
            top: 15px;
            right: 15px;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-light);
        }
        
        .close-modal:hover {
            color: var(--text-color);
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
        }
        
        .form-group textarea, .form-group input[type="text"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-family: inherit;
            font-size: 1rem;
        }
        
        .form-group textarea {
            resize: vertical;
            min-height: 100px;
        }
        
        .option-item {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .option-item input[type="radio"] {
            margin-right: 10px;
        }
        
        .option-item input[type="text"] {
            flex: 1;
        }
        
        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
            margin-top: 20px;
        }
        
        /* 页脚样式 */
        .footer {
            background-color: var(--dark-color);
            color: white;
            padding: 20px 0;
            text-align: center;
            margin-top: 50px;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .nav-container {
                flex-direction: column;
                align-items: flex-start;
            }
            
            nav ul {
                margin: 15px 0;
            }
            
            .quiz-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 15px;
            }
            
            .quiz-actions {
                width: 100%;
                flex-wrap: wrap;
            }
            
            .btn {
                flex: 1;
                min-width: 120px;
                justify-content: center;
            }
        };
        flex-wrap: wrap;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}